import java.util.Scanner;



public class test{
    //1~100间 既是3的倍数也是5的倍数【continue】
    public static void main(String[] args){
        int i = 1;
        while(i <= 100){
            if(i % 3 != 0 || i % 5 != 0){
                i++;
                continue;
            }
            System.out.print(i + " ");
            i++;
        }
    }

    //求5的阶乘的和1!+2!+3!+4!+5!
    public static void main5(String[] args){
        int i = 1;
        int sum = 0;
        int ret = 1;
        for(i = 1; i <= 5; i++){
            ret *= i;
            sum += ret;
        }
        System.out.println("1!+2!+3!+4!+5! = " + sum);
    }
    public static void main4(String[] args){
        int sum = 0;
        int i = 1;
        while(i <= 5){
            int j = 1;
            int ret = 1;
            while(j <= i){
                ret *= j;
                j++;
            }
            sum += ret;
            i++;
        }
        System.out.println("1!+2!+3!+4!+5! = " + sum);
    }

    //5的阶乘
    public static void main3(String[] args){
        int i = 2;
        int sum = 1;
        while(i <= 5){
            sum *= i;
            i++;
        }
        System.out.println("5的阶乘:" + sum);
    }
    //1~100奇数、偶数和
    public static void main2(String[] args){
        //1~100的和
        int sum1 = 0;
        int sum2 = 0;
        int i = 1;
        while(i <= 100){
            //奇数
            if(i % 2 == 0){
                sum1 += i;
            }
            else{
                sum2 += i;
            }
            i++;
        }
        System.out.println("1~100的和:" + (sum1 + sum2));
        System.out.println("1~100的奇数和:" + sum1);
        System.out.println("1~100的偶数和:" + sum2);

    }
//判断闰年
    public static void main1(String[] args){
        Scanner scanner = new Scanner(System.in);
        while(scanner.hasNext()){
            int day = scanner.nextInt();
            if(((day % 4 == 0) && (day % 100 != 0)) || (day % 400 == 0)){
                System.out.println(day + "是闰年!");
            }
            else{
                System.out.println(day+"不是闰年!");
            }
        }
    }
}